<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<!--xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"-->
<head>
    <th:block th:include="include :: header('话术列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>话术：</label>
                                <input type="text" name="verbalTrick"/>
                            </li>
                            <li>
                                <label>设备编号：</label>
                                <input type="text" name="equipmentId"/>
                            </li>
                            <li>
                                <label>微信号：</label>
                                <input type="text" name="wechatId"/>
                            </li>
                            <li>
                                <label>登录名称：</label>
                                <input type="text" name="userName"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
<!--                            <li>-->
<!--                                <label>话术：</label>-->
<!--                                <input name="verbalTrick"  type="text" id="Trick">-->
<!--                            <li>-->
<!--                                <button value="提交" onclick="up()">提交</button>-->
<!--                            </li>-->
<!--                            </li>-->
                        </ul>
                    </div>
                </form>
            </div>

<!--            <form class="form-horizontal m" id="form-list-add">-->
<!--                <div class="form-group">-->
<!--                    <label class="col-sm-3 control-label">话术：</label>-->
<!--                    <div class="col-sm-8">-->
<!--                        <input name="verbalTrick" class="form-control" type="text">-->
<!--                        <button type="submit">提交</button>-->
<!--                    </div>-->
<!--                </div>-->
<!--            </form>-->

<!--            <th:block th:include="include :: footer" />-->
<!--            <script th:inline="javascript">-->
<!--                var prefix = ctx + "system/list"-->
<!--                $("#form-list-add").validate({-->
<!--                    focusCleanup: true-->
<!--                });-->

<!--                function submitHandler() {-->
<!--                    if ($.validate.form()) {-->
<!--                        $.operate.save(prefix + "/add", $('#form-list-add').serialize());-->
<!--                    }-->
<!--                }-->

<!--                // function up(){-->
<!--                // $.ajax({-->
<!--                //     url: "/system/list/trick",-->
<!--                //     data: {verbalTrick: trick},-->
<!--                //     type: "POST",-->
<!--                // })-->
<!--                // }-->

<!--            </script>-->



            <div class="btn-group-sm" id="toolbar" role="group">
<!--                shiro:hasPermission="system:trick:add"-->
<!--                <a class="btn btn-success" onclick="$.operate.add()" >-->
<!--                    <i class="fa fa-plus"></i> 添加-->
<!--                </a>-->
<!--                shiro:hasPermission="system:trick:edit"-->
<!--                <a class="btn btn-primary single disabled" onclick="$.operate.edit()">-->
<!--                    <i class="fa fa-edit"></i> 修改-->
<!--                </a>-->
<!--                shiro:hasPermission="system:trick:remove"-->
<!--                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" >-->
<!--                    <i class="fa fa-remove"></i> 删除-->
<!--                </a>-->
<!--                shiro:hasPermission="system:trick:export"-->
                <a class="btn btn-warning" onclick="$.table.exportExcel()">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('system:trick:edit')}]];
        var removeFlag = [[${@permission.hasPermi('system:trick:remove')}]];
        var prefix = ctx + "system/trick";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "话术",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: '编号',
                    visible: false
                },
                {
                    field: 'verbalTrick',
                    title: '话术'
                },
                    // {
                    //     title: '话术',
                    //     align: 'center',
                    //     formatter: function(value, row, index) {
                    //
                    //         var actions = [];
                    //         // + editFlag
                    //         actions.push('<select id="123" placeholder="请选择">\n' +
                    //             '         </select>');
                    //         // + removeFlag
                    //         return actions.join('');
                    //     }
                    // },
                {
                    field: 'equipmentId',
                    title: '设备编号'
                },
                {
                    field: 'wechatId',
                    title: '微信号'
                },
                {
                    field: 'userName',
                    title: '登录名称'
                },
                    {
                        field: 'number',
                        title: '请求次数'
                    },
                    {
                        field: 'intervalTime',
                        title: '间隔时间'
                    },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {

                        var actions = [];
                        // + editFlag
                        actions.push('<a class="btn btn-success btn-xs ' + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        // actions.push('<a class="btn btn-danger btn-xs ' + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');

                        // + removeFlag
                        return actions.join('');
                    }
                }
                ]
            };
            $.table.init(options);
            document.onvisibilitychange=()=>{
                $.table.refresh()
            }
        });





    </script>
</body>
</html>